#ifndef __DEBUG_H
#define __DEBUG_H

#include "serial.h"

#ifndef NDEBUG
	#define DTRACE(STR) trace(STR)
	#define DTRACE_BIN(X) TRACE_BIN(X)
	#define DTRACE_DEC(X) TRACE_DEC(X)
	#define DTRACE_HEX(X) TRACE_HEX(X)

	#define ASSERT(CONDITION) \
		if(!(CONDITION)){\
		type0("#Error at " __FILE__ ":");\
		type0Dec(__LINE__); type0(": ");\
		trace("assert \"" #CONDITION "\" failed");}

#else
	#define DTRACE(STR)
	#define DTRACE_BIN(X)
	#define DTRACE_DEC(X)
	#define DTRACE_HEX(X)
	#define ASSERT(CONDITION) 
#endif

#endif
